import {Tools,Toast} from 'weaver-mobile';
const getLabel = Tools.getLabel;

const Constant = {
  
  catchApiError: (result) => {
    return new Promise((resolve, reject) => {
      if (!result.api_status) {
        Toast.fail(result.msg || getLabel(30651, '操作失败'));
        reject(result);
        return;
      }
      resolve(result);
    });
  },
}

export default Constant;